package edificapps.com.simuladorz80;

import android.graphics.Canvas;
import android.graphics.Paint;

public class myCanvas
{
    public Canvas canvas;
    private static boolean instance = false;
    
    public myCanvas()
    {
    }
    
    public void setClass(Canvas canvas){
        this.canvas = canvas;
    }
    public static void setInstance(){
    	instance = true;
    }
    
    public static boolean getInstance(){
    	return instance;
    }

    public void drawMultiline(String str, int x, int y, Paint paint)
    {
        for (String line: str.split("\n"))
        {
              canvas.drawText(line, x, y, paint);
              y += -paint.ascent() + paint.descent();
        }
    }
    public void drawLines(int lines, int x, int y, Paint paint)
    {
        for (int i = 1; i <= lines; i++)
        {
              canvas.drawText(String.valueOf(i), x, y, paint);
              y += -paint.ascent() + paint.descent();
        }
    }
}